home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.8 KB | 176 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ButtonPart.h
- // Release Version: $ 1.0d11 $
- //
- // Author: Henri Lamiraux
- // Modified by M.Boetcher to accept Dropped and Pasted sounds
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef BUTTONPART_H
- #define BUTTONPART_H
-
- // ----- Framework Layer -----
-
- #ifndef FWPART_H
- #include "FWPart.h"
- #endif
-
- #ifndef FWFRAME_H
- #include "FWFrame.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWHFCONN_H
- #include "FWHFConn.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import on
- #endif
- class FW_CLASS_ATTR FW_CNotification;
- class FW_CLASS_ATTR FW_CHandleFunctionConnection;
- class FW_CLASS_ATTR FW_CPushButton;
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import off
- #endif
-
- //========================================================================================
- // Forward declarations
- //========================================================================================
-
- class CAction;
-
- //========================================================================================
- // class CButtonPart
- //========================================================================================
-
- class FW_CLASS_ATTR CButtonPart : public FW_CPart
- {
- public:
- static const ODValueType kPartKind;
- static const ODValueType kPartUserName;
-
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CButtonPart(ODPart* odPart);
- virtual ~CButtonPart();
-
- virtual void Initialize(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_CFrame* NewFrame(Environment* ev,
- ODFrame* odFrame,
- FW_CPresentation* presentation,
- FW_Boolean fromStorage);
-
- virtual void InternalizeContent(Environment* ev,
- ODStorageUnit* storage,
- FW_CCloneInfo* cloneInfo);
-
- virtual void ExternalizeContent(Environment* ev,
- ODStorageUnit* storage,
- FW_CCloneInfo* cloneInfo);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- CAction* GetAction() { return fAction; }
- void SetAction(CAction* action);
-
- public:
- void DoAction();
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CAction* fAction;
- };
-
- //========================================================================================
- // class CButtonFrame
- //========================================================================================
-
- class FW_CLASS_ATTR CButtonFrame : public FW_CFrame
- {
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CButtonFrame(Environment* ev, ODFrame* frame,
- FW_CPresentation* presentation, CButtonPart* part);
- virtual ~CButtonFrame();
-
- //----------------------------------------------------------------------------------------
- // FW_CFrame overrides
- //
- public:
- virtual void CreateSubViews(Environment* ev);
- virtual void AdjustSubViews(Environment* ev);
-
- virtual ODDragResult CanAcceptDrop(Environment* ev,
- ODDragItemIterator* dragInfo);
-
- virtual void Draw(Environment* ev,
- ODFacet* facet,
- ODShape* invalidShape);
-
- virtual void FocusStateChanged(Environment *ev,
- ODTypeToken focus,
- FW_Boolean newState,
- ODFrame* newOwner);
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver overrides
- //
- public:
- virtual void HandleNotification(
- const FW_CNotification& notification);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CButtonPart* fButtonPart;
- FW_CPushButton* fButton;
- ODID fButtonId;
- FW_CHandleFunctionConnection fConnection;
- ODTypeToken fButtonNotificationToken;
- };
-
- //========================================================================================
- // class COptionBehavior
- //========================================================================================
-
- class COptionBehavior : public FW_MEventHandler
- {
- public:
- COptionBehavior(Environment* ev, CButtonFrame* frame, ODSession* session);
- virtual ~COptionBehavior();
-
- public:
- virtual FW_Boolean DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
-
- private:
- CButtonFrame* fFrame;
- FW_CFocusSet fFullFocusSet;
- FW_CFocusSet fEmptyFocusSet;
- };
-
- #endif
-